home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aas.d64
/
dbmanager
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
13KB
|
524 lines
1 PRINT"[147] [158] DATABASE MANAGER [146]"
2 REM DATABASE MANAGER WITH RELATIVE FILES: TREVOR JONES 05/31/86
3 PRINT" [158]TREVOR JONES 05/31/86"
4 REM ** MAIN MENU **
5 PRINT"[158] USING COMMODORE RELATIVE FILES [146]":FOR I=1 TO 300
6 IF INT(I/3)=I/3 THEN POKE53280,INT(RND(0)*10)
7 NEXT I:PRINT"[147]":CLR
8 PRINT TAB(10)"[158]DATABASE MANAGER"
9 PRINT TAB(15)" 0-FORMAT NEW DISK "
10 PRINT TAB(15)" 1-CREATE NEW FILE "
12 PRINT TAB(15)" 2-ADD TO A FILE "
14 PRINT TAB(15)" 3-VIEW FILE (PRINT,"
16 PRINT TAB(15)" SEARCH AND SORT) "
18 PRINT TAB(15)" 4-DELETE A FILE "
20 PRINT TAB(15)" 5-DELETE A RECORD "
22 PRINT TAB(15)" 6-FILE FORMAT "
23 PRINT TAB(15)" 7-CORRECTIONS "
24 PRINT TAB(15)" 8-QUIT "
26 PRINT TAB(5)"CHOOSE OPTION, ENTER NUMBER"
28 GET A$:IF A$="" THEN 28
30 A=VAL(A$)
31 IF A=0 THEN GOSUB 11000
32 IF A<1 OR A>8 THEN 6
34 ON A GOSUB 100,204,300,580,690,610,800,38
36 GOTO 5
38 PRINT"[147] ARE YOU FINISHED (Y/N)? "
40 GET E$:IF E$="" THEN 40
42 IF E$="N" THEN 5
44 PRINT" ALL DONE!! "
46 END
100 REM ** CREATE ROUTINE **
102 PRINT "[147]"
104 PRINT"CREATE A NEW FILE":PRINT"MUST ENTER AT LEAST ONE RECORD."
106 PRINT"PRESS RETURN[146] TO CONTINUE OR Q[146] FOR MENU"
107 GET C$:IF C$="" THEN 107
108 IF C$="Q" THEN RETURN
110 PRINT"[147]A RECORD IS MADE UP OF A NUMBER"
112 PRINT"OF FIELDS."
114 INPUT"HOW MANY FIELDS PER RECORD";NF
116 DIM L(NF),PZ(NF),D$(NF),T$(NF)
118 RL=0
120 FOR N=1 TO NF
122 PRINT"[147]":PRINT"LENGTH OF FIELD #";N
124 INPUT L(N)
126 RL=RL+L(N)
128 PZ(N)=RL-(L(N)-1)
129 PRINT"NAME OF FIELD (9 CHARACTERS OR LESS)"
130 INPUT T$(N):NEXT N
132 PRINT"[147]TO REVIEW YOUR FILE SET-UP ENTER R[146],"
134 PRINT"ELSE ENTER RETURN[146]."
136 GET REV$:IF REV$="" THEN 136
138 IF REV$<>"R" THEN 154
140 PRINT"[147] SET-UP [146]"
142 PRINT TAB(10)"RECORD LENGTH:";TAB(8);RL
144 FOR N=1 TO NF
146 PRINT TAB(10)"POSITION FOR FIELD ";N;": ";PZ(N)
148 PRINT TAB(5)"LENGTH = ";L(N);" NAME ";T$(N)
150 NEXT N:PRINT"ENTER S[146] TO START OVER"
152 PRINT"ENTER RETURN[146] TO CONTINUE":INPUT C$
153 IF C$="S" THEN 100
154 PRINT"[147]":PRINT"ENTER FILE NAME (UP TO 6 CHARACTERS)":INPUT F$
156 OPEN2,8,2,"0:"+F$+".PTR,S,W"
158 PTR=0:RN=PTR
160 PRINT#2,PTR
162 PRINT#2,RL
164 PRINT#2,NF
166 FOR N=1 TO NF
168 PRINT#2,PZ(N)
169 PRINT#2,T$(N)
170 NEXT N:CLOSE2
172 GOSUB 1000
176 RN=RN+1:GOSUB 8000:I=RN
188 GOSUB 2000
190 GOSUB 3000
192 PRINT"[147]ANOTHER RECORD (Y/N)?"
194 GET A$:IF A$="" THEN 194
196 IF A$="Y" THEN 172
198 PRINT" CLOSING FILES...."
199 PTR=RN
200 GOSUB 4000
202 RETURN
204 REM ** ADDITION ROUTINE **
206 PRINT"[147] ADD TO OLD FILE "
208 PRINT"PRESS RETURN[146] TO CONTINUE OR Q[146] FOR MENU"
209 GET C$:IF C$="" THEN 209
210 IF C$="Q" THEN RETURN
211 PRINT"[147]ENTER D[146]IRECTORY OR RETURN[146] TO CONTINUE"
212 GET A$:IF A$="D" THEN GOSUB 10000
213 IF A$="" THEN 212
214 PRINT"[147] FILE NAME FOR ADDITION "
216 INPUT F$
218 PRINT"[147] ONE MOMENT...."
220 GOSUB 5000
222 GOSUB 1000
224 RN=PTR+1:GOSUB 8000:I=RN:PTR=RN
226 GOSUB 2000
228 GOSUB 3000
230 PRINT"[147]ANOTHER RECORD (Y/N)?"
232 GET A$:IF A$="" THEN 232
234 IF A$="Y" THEN 222
236 PRINT" CLOSING FILES...."
238 GOSUB 4000
240 RETURN
300 REM ** VIEW FILE ROUTINE **
302 PRINT"[147] VIEW FILE - SEARCH, SORT AND PRINT ":X=0:T=0
304 PRINT"PRESS RETURN[146] TO CONTINUE OR Q[146] FOR MENU"
305 GET C$:IF C$="" THEN 305
306 IF C$="Q" THEN RETURN
307 PRINT"[147]ENTER D[146]IRECTORY OR RETURN[146] TO CONTINUE"
308 GET A$:IF A$="" THEN 308
309 IF A$="D" THEN GOSUB 10000
310 PRINT"[147] NAME OF FILE FOR VIEWING? "
312 INPUT F$
314 GOSUB 5000
316 PRINT"[147] VIEW MENU "
318 PRINT TAB(5)" 1-TOTAL FILE "
320 PRINT TAB(5)" 2-INDIVIDUAL RECORD "
322 PRINT TAB(5)" 3-SEARCH "
324 PRINT TAB(5)" 4-SORT "
326 PRINT TAB(5)" 5-RETURN TO MAIN MENU "
328 PRINT"CHOOSE OPTION, ENTER NUMBER"
330 GET A$:IF A$="" THEN 330
331 IF VAL(A$)<1ORVAL(A$)>5 THEN 316
332 IF VAL(A$)=5 THEN RETURN
334 ON VAL(A$) GOSUB 338,388,426,524
336 GOTO 316
338 PRINT"[147]REVIEW ENTIRE FILE ";F$;"[146]"
340 PRINT"GETTING FILE, PLEASE WAIT..."
342 FOR I=1 TO PTR
344 GOSUB 1000
346 RN=I:GOSUB 8000
348 GOSUB 6000
352 GOSUB 3000
356 PRINT"[147]RECORD #";I
358 FOR N=1 TO NF
360 PRINT N;":";T$(N);":";D$(N)
362 NEXT N
364 PRINT"ENTER C[146] TO CONTINUE, Q[146] TO QUIT"
365 PRINT"OR P[146] TO PRINT ENTIRE FILE"
366 GET A$:IF A$="" THEN 366
368 IF A$="Q" THEN N=NF:I=PTR:RETURN
369 IF A$="P" THEN N=NF:I=PTR:GOTO 379
370 NEXT I
372 PRINT"[147]END OF FILE";SPC(2);PTR;" RECORDS"
374 PRINT"DO YOU WANT A HARDCOPY (Y/N)?"
376 GET A$:IF A$="" THEN 376
378 IF A$="N" THEN RETURN
379 PRINT"[147]PRINTING ";PTR;" RECORDS OF FILE ";F$:GOSUB 1000
380 FOR I=1 TO PTR:RN=I:GOSUB 8000
381 GOSUB 6000
382 GOSUB 7000
384 NEXT I
385 GOSUB 3000
386 RETURN
388 PRINT"[147]REVIEW INDIVIDUAL RECORDS"
389 PRINT"THERE ARE ";PTR;" RECORDS."
390 INPUT"WHAT RECORD NUMBER";I
391 IF I>PTR THEN PRINT"[145][145][145]":GOTO 390
392 PRINT"GETTING RECORD...":FOR Q=1 TO 500:NEXT Q
394 RN=I:GOSUB 8000
396 GOSUB 1000
398 PRINT"[147]RECORD #";I
400 GOSUB 6000
402 GOSUB 3000
404 FOR N=1 TO NF
406 PRINT N;":";T$(N);":";D$(N)
408 NEXT N
410 PRINT"DO YOU WANT A HARDCOPY (Y/N)"
411 GET R$:IF R$="" THEN 411
412 IF R$="Y" THEN GOSUB 7000
414 PRINT"ANOTHER RECORD NUMBER?"
416 PRINT"ENTER RECORD NUMBER OR N[146]O"
418 INPUT A$:IF A$="" THEN 418
420 IF A$="N" THEN RETURN
422 I=VAL(A$):GOTO 392
424 RETURN
426 REM ** SEARCH **
428 PRINT"[147] SEARCH ":DIM GS(PTR)
430 PRINT"FIND RECORDS WITH COMMON FIELDS"
432 PRINT"ENTIRE FIELD IS NOT NECESSARY"
436 PRINT"ENTER RETURN[146] TO CONTINUE OR Q[146] FOR MENU"
437 GET C$:IF C$="" THEN 437
438 IF C$="Q" THEN RETURN
440 PRINT"[147]"TAB(10)"LIST OF FIELDS AND TITLES"
442 FOR N=1 TO NF
444 PRINT TAB(10)"FIELD ";N;": ";T$(N)
446 NEXT N
448 INPUT"ENTER FIELD NUMBER TO SEARCH";I:P=I
450 IF I>NF THEN 440
452 SF=PZ(I)
454 PRINT"[147]ENTER COMMON ITEM FOR SEARCH"
456 INPUT CS$:NR=PTR
458 GOSUB 1000
460 K=0
462 FOR I=1 TO NR
464 PRINT"[147] SEARCHING RECORD #";I
466 RN=I:GOSUB 8000
468 PRINT#15,"P";CHR$(3);CHR$(RI);CHR$(RH);CHR$(SF)
470 INPUT#3,D$
471 S=LEN(CS$):L=LEN(D$)
472 FOR N=1 TO L-S+1:IF CS$=MID$(D$,N,S) THEN N=L-S+1:K=K+1:GS(K)=I
473 NEXT N
476 NEXT I:GOSUB 3000
478 PRINT"[147]THE FOLLOWING RECORDS WERE FOUND":CK=0:PT=0
480 FOR I=1 TO K-1
482 PRINT GS(I);",";:NEXT I:PRINT GS(K):PRINT
484 PRINT"CHOOSE NUMBER TO VIEW OR A[146]LL"
485 PRINT "ENTER P[146] FOR HARDCOPY OR Q[146] FOR MENU"
486 INPUT A$:IF A$="Q" THEN RETURN
487 IF A$="P" THEN 500
488 IF A$<>"A" THEN 502
490 FOR L=1 TO K:CK=1
491 I=GS(L)
492 RN=GS(L):GOSUB 8000
494 GOSUB 503
495 IF A$="P" THEN 497
496 PRINT"PRESS RETURN[146] TO CONTINUE":INPUT R$
497 NEXT L:PRINT"ENTER P[146] FOR A HARDCOPY OF ALL"
498 PRINT"ENTER RETURN[146] TO CONTINUE"
499 GET A$:IF A$="" THEN 499
500 IF A$="P" THEN PT=1:GOTO 490
501 IF A$=CHR$(13) THEN 478
502 RN=VAL(A$):GOSUB 8000:I=RN
503 GOSUB 1000
504 GOSUB 6000
506 GOSUB 3000
507 IFPT=1THENOPEN4,4:PRINT#4:PRINT#4,"SEARCH FIELD '";T$(P);"' FOR ";CS$
508 IF PT=1 THEN PRINT#4:CLOSE4:PT=2
509 IF PT=2 THEN GOSUB 7000:RETURN
510 PRINT"[147] RECORD #";RN
511 FOR N=1 TO NF
512 PRINT"FIELD #";N;":";T$(N);":";D$(N)
514 NEXT N:IF CK=1 THEN RETURN
516 PRINT"ENTER C[146] TO CONTINUE OR Q[146] FOR MENU"
517 PRINT"ENTER P[146] FOR HARDCOPY"
518 GET B$:IF B$="" THEN 518
520 IF B$="C" THEN 478
521 IF B$="P" THEN GOSUB 7000:GOTO 478
522 RETURN
524 REM ** SORT ROUTINE **
525 PRINT"[147] SORT FILES [146]"
526 PRINT" THIS SORTS THE FILES ON THE DISK AND IS SLOW! ENOUGH TIME FOR";
527 PRINT" LUNCH AND DINNER. THIS IS NOT NECESSARY WITH RANDOM FILES"
528 PRINT" BUT IF YOU MUST.... [146][158]":PRINT"ENTER RETURN[146] TO CONTINUE"
529 PRINT"[158]OR Q[146] FOR VIEW MENU"
530 GET A$:IF A$="" THEN 530
531 IF A$="Q" THEN 316
532 PRINT"[147]CHOOSE ONE OF THE FOLLOWING FIELD"
533 PRINT"NUMBERS FOR THE ASCENDING SORT"
534 FOR N=1 TO NF:PRINT N;T$(N):NEXT N
535 PRINT
536 INPUT"WHICH FIELD NUMBER";SF
537 PRINT"[147]SORTING.........."
538 S=0:F=1:L=PTR:DIM M$(NF),A$(NF),B$(NF),DT$(PTR,NF):GOSUB 1000
539 FOR I=1 TO PTR:RN=I:GOSUB 8000:GOSUB 6000
540 FOR N=1 TO NF:DT$(I,N)=D$(N):NEXT N
541 NEXT I:GOSUB 3000
542 RN=INT((L+F)/2)
543 FOR N=1 TO NF:M$(N)=DT$(RN,N):NEXT N
544 I=F:J=L
545 A$(SF)=DT$(I,SF)
546 IF A$(SF)<M$(SF) THEN I=I+1:GOTO545
547 B$(SF)=DT$(J,SF)
548 IF B$(SF)>M$(SF) THEN J=J-1:GOTO547
549 IF I>J THEN 559
550 IF I=J THEN 557
551 FOR N=1 TO NF:A$(N)=DT$(I,N):B$(N)=DT$(J,N)
552 TEMP$=A$(N)
553 A$(N)=B$(N)
554 B$(N)=TEMP$
555 NEXT N
556 FOR K=1 TO NF:DT$(I,K)=A$(K):DT$(J,K)=B$(K):NEXT K
557 I=I+1:J=J-1
558 IF I<=J THEN 545
559 IF I>=L THEN 561
560 F(S)=I:L(S)=L:S=S+1
561 L=J:IF F<L THEN 542
562 IF S=0 THEN 564
563 S=S-1:F=F(S):L=L(S):GOTO 542
564 GOSUB 1000
565 FOR I=1 TO PTR:RN=I:GOSUB 8000
566 FOR N=1 TO NF
567 D$(N)=DT$(I,N)
568 NEXT N:GOSUB 9100
569 NEXT I:GOSUB 3000
571 RETURN
580 REM ** FILE DELETION **
582 PRINT"[147] FILE DELETION [146]"
584 PRINT"PRESS RETURN[146] TO CONTINUE OR Q[146] FOR MENU"
585 GET C$:IF C$="" THEN 585
586 IF C$="Q" THEN RETURN
588 PRINT"[147] ENTER FILE TO BE DELETED "
590 INPUT F$
592 PRINT"ARE YOU SURE (Y/N)?"
594 PRINT"-------------------"
596 GET A$:IF A$="" THEN 596
598 IF A$="N" THEN RETURN
600 PRINT"[147] DELETING FILES ASSOCIATED WITH ";F$
602 OPEN15,8,15
604 PRINT#15,"S0:"+F$+".*"
606 CLOSE 15
608 RETURN
610 REM ** FORMAT ROUTINE **
614 PRINT"[147]"TAB(10)" FORMAT MENU "
618 PRINT TAB(15)" 1-REVIEW FORMAT "
620 PRINT TAB(15)" 2-RETURN TO MAIN MENU "
626 PRINT"CHOOSE OPTION, ENTER NUMBER"
628 GET A$:IF A$="" THEN 628
630 ON VAL(A$) GOSUB 664,632
632 RETURN
664 PRINT"[147]ENTER FILE NAME"
666 INPUT F$:PRINT"[147] GETTING DATA..."
668 OPEN2,8,2,"0:"+F$+".PTR,S,R"
670 INPUT#2,PTR,RL,NF
671 DIM T$(NF),PZ(NF)
672 FOR N=1 TO NF
674 INPUT#2,PZ(N),T$(N)
676 NEXT N:CLOSE2
678 PRINT"[147] FORMAT FOR ";F$
680 FOR N=1 TO NF
682 PRINT TAB(5)"FIELD ";N;":";T$(N);" POSITION ";PZ(N)
684 NEXT N
686 PRINT"ENTER RETURN[146] TO CONTINUE":INPUT R$
688 RETURN
690 REM ** RECORD DELETION **
692 PRINT"[147] RECORD DELETION "
694 PRINT"ENTER RETURN[146] TO CONTINUE OR Q[146] FOR MENU"
696 GET A$:IF A$="" THEN 696
698 IF A$="Q" THEN RETURN
700 PRINT"[147] NAME OF FILE TO ACCESS? "
702 INPUT F$
704 GOSUB 5000
706 PRINT"[147]THERE ARE ";PTR;" RECORDS."
708 PRINT"ENTER THE RECORD NUMBER TO DELETE."
710 INPUT DN:IF DN>PTR THEN 706
712 RN=DN:GOSUB 8000:I=DN
714 GOSUB 1000
716 GOSUB 6000
718 GOSUB 3000
719 PRINT"[147]RECORD #";I:PRINT
720 FOR N=1 TO NF
722 PRINT N;":";D$(N)
724 NEXT N
726 PRINT"IS THIS THE RECORD TO DELETE (Y/N)?"
728 GET A$:IF A$="" THEN 728
730 IF A$="N" THEN PRINT"[147]TRY AGAIN!":GOTO 706
732 PRINT"ARE YOU SURE (Y/N)?"
734 GET A$:IF A$="" THEN 734
736 IF A$="N" THEN RETURN
738 PRINT"[147]DELETING RECORD AND PACKING..."
740 GOSUB 1000
742 FOR I=DN+1 TO PTR
744 RN=I:GOSUB 8000
746 GOSUB 6000
748 RN=I-1:GOSUB 8000
750 GOSUB 9100
752 NEXT I
754 GOSUB 3000
756 PTR=PTR-1
758 PRINT"[147]ANOTHER RECORD FOR DELETION (Y/N)?"
760 GET A$:IF A$="" THEN 760
762 IF A$="Y" THEN 706
764 GOSUB 4000
766 RETURN
800 PRINT"[147]CORRECTIONS TO FIELD IN A RECORD"
802 PRINT"PRESS RETURN[146] TO CONTINUE OR Q[146] FOR MENU"
803 GET C$:IF C$="" THEN 803
804 IF C$="Q" THEN RETURN
806 INPUT"[147]NAME OF FILE FOR CORRECTION";F$
808 GOSUB 5000
810 PRINT"[147]THERE ARE ";PTR;" RECORDS"
812 PRINT"ENTER RECORD NUMBER FOR CORRECTION"
813 INPUT"OR Q[146] FOR MENU";RC$
814 IF RC$="Q" THEN RETURN
815 RN=VAL(RC$):GOSUB 8000
816 GOSUB 1000
818 GOSUB 6000:GOSUB 3000
820 PRINT"[147]":FOR N=1 TO NF
822 PRINT"FIELD #";N;" ";T$(N);":";D$(N)
824 NEXT N
825 PRINT"ENTER FIELD NUMBER FOR CORRECTION":PRINT"OR N[146] FOR NEXT"
826 PRINT"OR OK[146] TO SAVE":INPUT N$
827 IF LEFT$(N$,1)="O" THEN 836
828 AX=VAL(N$):IF N$="N" THEN 810
829 PRINT"[147]FIELD #";AX;" ";T$(AX);":";D$(AX)
830 PRINT"ENTER NEW FIELD"
832 INPUT D$(AX)
834 GOTO 820
836 FOR N=1 TO NF:I=RN
838 SW$(I,N)=D$(N)
840 NEXT N
841 PRINT"[147]CORRECTING RECORD N0.";RN
842 GOSUB 1000:GOSUB 9000:GOSUB 3000
844 GOTO 810
1000 REM ** OPEN .DBF **
1002 OPEN15,8,15
1004 OPEN3,8,3,F$+".DBF,L,"+CHR$(RL)
1006 RETURN
2000 REM ** ENTER .DBF DATA **
2001 FOR N=1 TO NF
2002 PRINT"[147]RECORD #";I
2003 PRINT"ENTER DATA FOR FIELD #";N;":";T$(N)
2004 D$(N)="":INPUT D$(N):IF D$(N)="" THEN D$(N)="*"
2005 PRINT#15,"P";CHR$(3);CHR$(RI);CHR$(RH);CHR$(PZ(N))
2006 PRINT#3,D$(N)
2008 NEXT N
2010 RETURN
3000 REM ** CLOSE .DBF **
3002 CLOSE3
3004 CLOSE15
3006 RETURN
4000 REM ** REWRITE .PTR **
4002 OPEN2,8,2,"@0:"+F$+".PTR,S,W"
4004 PRINT#2,PTR
4006 PRINT#2,RL
4008 PRINT#2,NF
4010 FOR N=1 TO NF
4012 PRINT#2,PZ(N):PRINT#2,T$(N)
4014 NEXT N
4016 CLOSE2
4018 RETURN
5000 REM ** READ .PTR **
5002 OPEN2,8,2,"0:"+F$+".PTR,S,R"
5004 INPUT#2,PTR,RL,NF
5006 DIM PZ(NF),D$(NF),TEMP$(NF),SW$(PTR,NF),T$(NF)
5008 FOR N=1 TO NF
5010 INPUT#2,PZ(N),T$(N)
5012 NEXT N
5014 CLOSE2
5016 RETURN
6000 REM ** READ .DBF **
6002 FOR N=1 TO NF
6004 PRINT#15,"P";CHR$(3);CHR$(RI);CHR$(RH);CHR$(PZ(N))
6006 INPUT#3,D$(N)
6008 NEXT N
6010 RETURN
7000 REM ** PRINT ROUTINE **
7002 OPEN4,4
7004 PRINT#4,"RECORD #";I:GOSUB 7020
7006 FOR N=1 TO NF
7007 S=10-LEN(T$(N))
7008 PRINT#4,N;":";T$(N);":";SPC(S);D$(N):GOSUB 7020
7010 NEXT N
7012 PRINT#4:T=T+1:CLOSE4
7014 RETURN
7020 T=T+1
7022 IF T>=59 THEN T=0:FOR K=1 TO 4:PRINT#4,CHR$(13):NEXT K
7024 RETURN
8000 REM ** RECORD NUMBER ROUTINE **
8002 RI=RN
8004 RH=0
8006 IF RI>255 THEN 8010
8008 RETURN
8010 RH=INT(RI/256)
8012 RI=RI-256*RH
8014 RETURN
9000 REM ** REWRITE .DBF DATA **
9002 FOR N= 1 TO NF
9004 PRINT#15,"P";CHR$(3);CHR$(RI);CHR$(RH);CHR$(PZ(N))
9006 PRINT#3,SW$(I,N)
9008 NEXT N
9010 RETURN
9100 REM ** ANOTHER WRITE .DBF **
9101 FOR N=1 TO NF
9102 PRINT#15,"P";CHR$(3);CHR$(RI);CHR$(RH);CHR$(PZ(N))
9104 PRINT#3,D$(N)
9106 NEXT N
9108 RETURN
10000 REM ** DISK ROUTINE **
10002 OPEN2,8,15
10004 PRINT"[147]":GOTO 10068
10006 OPEN1,8,0,"$0"
10008 GET#1,A$,B$
10010 GET#1,A$,B$
10012 GET#1,A$,B$
10014 C=0
10016 IF A$<>"" THEN C=ASC(A$)
10018 IF B$<>"" THEN C=C+ASC(B$)*256
10020 PRINT""MID$(STR$(C),2);TAB(3);"[146]"
10022 GET#1,B$:IF ST<>0 THEN 10040
10024 IF B$<>CHR$(34) THEN 10022
10026 GET#1,B$:IF B$<>CHR$(34) THEN PRINT B$;:GOTO 10026
10028 GET#1,B$:IF B$=CHR$(32) THEN 10028
10030 PRINT TAB(18);:C$=""
10032 C$=C$+B$:GET#1,B$:IF B$<>"" THEN 10032
10034 PRINT""LEFT$(C$,3)
10036 GET T$:IF T$<>"" THEN GOSUB 10044:IF T$="Q" THEN 10088
10038 IF ST=0 THEN 10010
10040 PRINT" BLOCKS FREE"
10042 CLOSE1:GOTO 10068
10044 IF T$="Q" THEN CLOSE1:RETURN
10046 GET T$:IF T$="" THEN 10044
10048 RETURN
10050 REM DISK COMMAND
10052 C$="":PRINT">";
10054 GET B$:IF B$="" THEN 10054
10056 PRINT B$;:IF B$=CHR$(13) THEN 10060
10058 C$=C$+B$:GOTO 10054
10060 PRINT#2,C$
10062 PRINT"";
10064 GET#2,A$:PRINT A$;:IF A$<>CHR$(13) GOTO 10064
10066 PRINT"[146]"
10068 PRINT "D-DIRECTORY"
10072 PRINT "Q-QUIT DISK ROUTINE"
10074 PRINT "S-DISK STATUS"
10075 PRINT""
10076 GET A$:IF A$="" THEN 10076
10078 IF A$="D" THEN 10006
10082 IF A$="Q" THEN 10088
10084 IF A$="S" THEN 10062
10086 GOTO 10076
10088 CLOSE2:RETURN
11000 REM ** FORMAT NEW DISK ROUTINE **
11002 PRINT"[147] FORMAT NEW DISK [146]"
11004 PRINT"ARE YOU SURE, FORMATTING ERASES DISK!"
11006 PRINT" Y[146]ES OR N[146]O? "
11008 GET A$:IF A$="" THEN 11008
11010 IF A$="N" THEN RETURN
11012 INPUT"[147]WHAT IS DISK NAME";DN$
11014 INPUT"WHAT IS THE UNIQUE DISK NUMBER";UN
11016 OPEN15,8,15
11018 PRINT#15,"N0:"+DN$+","+STR$(UN)
11020 CLOSE15:RETURN